﻿using System.Text;
using System.Security.Cryptography;

namespace MyBlog.WebApi.MD5Tool
{
    public static  class MD5Helper
    {
        public static string MD5Encryption(string pwd)
        {
            string md5_pwd = "";
            MD5 md5 = MD5.Create();
            byte[] temp = md5.ComputeHash(Encoding.UTF8.GetBytes(pwd));
            foreach (byte items in temp)
            {
                md5_pwd += items.ToString("X");
            }
            return md5_pwd; 
        }
    }
}
